/* eslint-disable */

import { AxiosRequestConfig } from 'axios';
import { request } from '../../utils/request';

export interface PostCosUploadFileRes {
  code: string; // 返回编码
  msg: string; // 返回消息
  data: {
    photoPath: string; // cos key
    photoUrl: string; // cos previewURL
    md5: string;
    photoSize: number;
    photoHeight: number;
    photoWidth: number;
  };
  traceId: string;
}

/**
 * 上传文件
 */
export async function postCosUploadFile(
  data: any,
  config: AxiosRequestConfig,
): Promise<PostCosUploadFileRes> {
  return request(data, {
    url: '/cos/uploadFile',
    method: 'post',
    ...config,
  });
}
